<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Class: TableSetter::Table</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (T)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../TableSetter.html" title="TableSetter (module)">TableSetter</a></span></span>
     &raquo; 
    <span class="title">Table</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: TableSetter::Table
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">TableSetter::Table</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/table_setter/table.rb</dd>
  
</dl>
<div class="clear"></div>



  <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#data-instance_method" title="#data (instance method)">- (Object) <strong>data</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#facets-instance_method" title="#facets (instance method)">- (Object) <strong>facets</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#next_page-instance_method" title="#next_page (instance method)">- (Object) <strong>next_page</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#page-instance_method" title="#page (instance method)">- (Object) <strong>page</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#prev_page-instance_method" title="#prev_page (instance method)">- (Object) <strong>prev_page</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#table_opts-instance_method" title="#table_opts (instance method)">- (Object) <strong>table_opts</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu.
</p>
</div></span>
  
</li>

    
  </ul>


  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#all-class_method" title="all (class method)">+ (Object) <strong>all</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns all the tables in the table directory.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#exists%3F-class_method" title="exists? (class method)">+ (Boolean) <strong>exists?</strong>(slug) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Does a table with this slug exist?.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#fresh_yaml_time-class_method" title="fresh_yaml_time (class method)">+ (Object) <strong>fresh_yaml_time</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
<tt>fresh_yaml_time</tt> checks each file in the tables directory and
returns the newest file&#8217;s modification time &#8212; there&#8217;s
probably a more unix-y way to do this but for now this is plenty speedy.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#table_path-class_method" title="table_path (class method)">+ (Object) <strong>table_path</strong>(slug) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Convenience method for looking up by slug.
</p>
</div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#csv_data-instance_method" title="#csv_data (instance method)">- (Object) <strong>csv_data</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The csv_data for the table fu instance is loaded either from the remote
source or from a local file, depending on the keys present in the yaml
file.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#faceted%3F-instance_method" title="#faceted? (instance method)">- (Boolean) <strong>faceted?</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#hard_paginate%3F-instance_method" title="#hard_paginate? (instance method)">- (Boolean) <strong>hard_paginate?</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
hard_paginate instructs the app to render batches of a table.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Table) <strong>initialize</strong>(slug, opts = {:defer =&gt; false}) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A new Table should accept a slug, mapped to a yaml in the tables directory,
optionally you can defer loading of the table until you&#8217;re ready to
render it.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#load-instance_method" title="#load (instance method)">- (Object) <strong>load</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The load method handles the actual request either to the file system or
remote url.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#method_missing-instance_method" title="#method_missing (instance method)">- (Object) <strong>method_missing</strong>(method) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
We magically need access to the top level keys like google_key, or uri for
the other methods.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#paginate%21-instance_method" title="#paginate! (instance method)">- (Object) <strong>paginate!</strong>(curr_page) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
paginate uses TableFu&#8217;s only! method to batch the table.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#per_page-instance_method" title="#per_page (instance method)">- (Object) <strong>per_page</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The number of rows per page.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#sort_array-instance_method" title="#sort_array (instance method)">- (Object) <strong>sort_array</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A convienence method to return the sort array for table setter.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#sortable%3F-instance_method" title="#sortable? (instance method)">- (Boolean) <strong>sortable?</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A table isn&#8217;t sortable by tablesorter if it&#8217;s either faceted or
multi-page paginated.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#total_pages-instance_method" title="#total_pages (instance method)">- (Object) <strong>total_pages</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The total pages we&#8217;ll have.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#updated_at-instance_method" title="#updated_at (instance method)">- (Object) <strong>updated_at</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The real <tt>updated_at</tt> of a Table instance is the newer modification
time of the csv file or the yaml file.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#uri-instance_method" title="#uri (instance method)">- (Object) <strong>uri</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns a usable uri based on what sort of input we have.
</p>
</div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="TableSetter::Table (class)">Table</a></span></tt>) <strong>initialize</strong>(slug, opts = {:defer =&gt; false}) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new Table should accept a slug, mapped to a yaml in the tables directory,
optionally you can defer loading of the table until you&#8217;re ready to
render it.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


14
15
16
17
18
19
20
21
22</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 14</span>

<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='slug identifier id'>slug</span><span class='comma token'>,</span> <span class='opts identifier id'>opts</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='symbol val'>:defer</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='false false kw'>false</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
  <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='indifferent_access identifier id'>indifferent_access</span> <span class='YAML constant id'>YAML</span><span class='dot token'>.</span><span class='load_file identifier id'>load_file</span><span class='lparen token'>(</span><span class='Table constant id'>Table</span><span class='dot token'>.</span><span class='table_path identifier id'>table_path</span><span class='lparen token'>(</span><span class='slug identifier id'>slug</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
  <span class='@table_opts ivar id'>@table_opts</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:table</span><span class='rbrack token'>]</span>
  <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:slug</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='slug identifier id'>slug</span>
  <span class='@deferred ivar id'>@deferred</span> <span class='assign token'>=</span> <span class='opts identifier id'>opts</span><span class='lbrack token'>[</span><span class='symbol val'>:defer</span><span class='rbrack token'>]</span>
  <span class='if if kw'>if</span> <span class='notop op'>!</span><span class='@deferred ivar id'>@deferred</span>
    <span class='self self kw'>self</span><span class='dot token'>.</span><span class='load identifier id'>load</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>
<div id="method_missing_details" class="method_details_list">
  <h2>Dynamic Method Handling</h2>
  <p class="notice this">
    This class handles dynamic methods through the <tt>method_missing</tt> method
    
  </p>
  
    <div class="method_details first">
  <p class="signature first" id="method_missing-instance_method">
  
    - (<tt>Object</tt>) <strong>method_missing</strong>(method) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
We magically need access to the top level keys like google_key, or uri for
the other methods. It&#8217;s a bit dangerous because everything returns
nil otherwise. At some point we should eval and create methods at boot
time.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


115
116
117
118
119</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 115</span>

<span class='def def kw'>def</span> <span class='method_missing identifier id'>method_missing</span><span class='lparen token'>(</span><span class='method identifier id'>method</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='method identifier id'>method</span><span class='rbrack token'>]</span>
    <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='method identifier id'>method</span><span class='rbrack token'>]</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id=""></span>
      <span id="data-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="data-instance_method">
  
    - (<tt>Object</tt>) <strong>data</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 10</span>

<span class='def def kw'>def</span> <span class='data identifier id'>data</span>
  <span class='@data ivar id'>@data</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="facets-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="facets-instance_method">
  
    - (<tt>Object</tt>) <strong>facets</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 10</span>

<span class='def def kw'>def</span> <span class='facets identifier id'>facets</span>
  <span class='@facets ivar id'>@facets</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="next_page-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="next_page-instance_method">
  
    - (<tt>Object</tt>) <strong>next_page</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 10</span>

<span class='def def kw'>def</span> <span class='next_page identifier id'>next_page</span>
  <span class='@next_page ivar id'>@next_page</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="page-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="page-instance_method">
  
    - (<tt>Object</tt>) <strong>page</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 10</span>

<span class='def def kw'>def</span> <span class='page identifier id'>page</span>
  <span class='@page ivar id'>@page</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="prev_page-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="prev_page-instance_method">
  
    - (<tt>Object</tt>) <strong>prev_page</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 10</span>

<span class='def def kw'>def</span> <span class='prev_page identifier id'>prev_page</span>
  <span class='@prev_page ivar id'>@prev_page</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id=""></span>
      <span id="table_opts-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="table_opts-instance_method">
  
    - (<tt>Object</tt>) <strong>table_opts</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The <tt>Table</tt> class handles processing the yaml processing and csv
loading, through table fu
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 10</span>

<span class='def def kw'>def</span> <span class='table_opts identifier id'>table_opts</span>
  <span class='@table_opts ivar id'>@table_opts</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="all-class_method">
  
    + (<tt>Object</tt>) <strong>all</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns all the tables in the table directory. Each table is deferred so
accessing the @data attribute will throw and error.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


180
181
182
183
184
185
186
187</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 180</span>

<span class='def def kw'>def</span> <span class='all identifier id'>all</span>
  <span class='tables identifier id'>tables</span><span class='assign token'>=</span><span class='lbrack token'>[</span><span class='rbrack token'>]</span>
  <span class='Dir constant id'>Dir</span><span class='dot token'>.</span><span class='glob identifier id'>glob</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{TableSetter.table_path}/*.yml&quot;</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='file identifier id'>file</span><span class='bitor op'>|</span>
    <span class='table identifier id'>table</span> <span class='assign token'>=</span> <span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='basename identifier id'>basename</span><span class='lparen token'>(</span><span class='file identifier id'>file</span><span class='comma token'>,</span> <span class='string val'>&quot;.yml&quot;</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='symbol val'>:defer</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='true true kw'>true</span><span class='rparen token'>)</span>
    <span class='tables identifier id'>tables</span> <span class='lshft op'>&lt;&lt;</span> <span class='table identifier id'>table</span> <span class='if if_mod kw'>if</span> <span class='table identifier id'>table</span><span class='dot token'>.</span><span class='live identifier id'>live</span>
  <span class='end end kw'>end</span>
  <span class='tables identifier id'>tables</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="exists?-class_method">
  
    + (<tt>Boolean</tt>) <strong>exists?</strong>(slug) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Does a table with this slug exist?
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


211
212
213</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 211</span>

<span class='def def kw'>def</span> <span class='exists? fid id'>exists?</span><span class='lparen token'>(</span><span class='slug identifier id'>slug</span><span class='rparen token'>)</span>
  <span class='File constant id'>File</span><span class='dot token'>.</span><span class='exists? fid id'>exists?</span> <span class='table_path identifier id'>table_path</span><span class='lparen token'>(</span><span class='slug identifier id'>slug</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="fresh_yaml_time-class_method">
  
    + (<tt>Object</tt>) <strong>fresh_yaml_time</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
<tt>fresh_yaml_time</tt> checks each file in the tables directory and
returns the newest file&#8217;s modification time &#8212; there&#8217;s
probably a more unix-y way to do this but for now this is plenty speedy.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


192
193
194
195
196
197
198
199
200
201
202
203</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 192</span>

<span class='def def kw'>def</span> <span class='fresh_yaml_time identifier id'>fresh_yaml_time</span>
  <span class='newest_file identifier id'>newest_file</span> <span class='assign token'>=</span> <span class='Dir constant id'>Dir</span><span class='lbrack token'>[</span><span class='dstring node'>&quot;#{TableSetter.table_path}/*.yml&quot;</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='inject identifier id'>inject</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='memo identifier id'>memo</span><span class='comma token'>,</span> <span class='obj identifier id'>obj</span><span class='bitor op'>|</span>
    <span class='memo_time identifier id'>memo_time</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='expand_path identifier id'>expand_path</span> <span class='memo identifier id'>memo</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='mtime identifier id'>mtime</span>
    <span class='obj_time identifier id'>obj_time</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='expand_path identifier id'>expand_path</span> <span class='obj identifier id'>obj</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='mtime identifier id'>mtime</span>
    <span class='if if kw'>if</span> <span class='memo_time identifier id'>memo_time</span> <span class='gt op'>&gt;</span> <span class='obj_time identifier id'>obj_time</span>
      <span class='memo identifier id'>memo</span>
    <span class='else else kw'>else</span>
      <span class='obj identifier id'>obj</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='File constant id'>File</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='newest_file identifier id'>newest_file</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='mtime identifier id'>mtime</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="table_path-class_method">
  
    + (<tt>Object</tt>) <strong>table_path</strong>(slug) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Convenience method for looking up by slug.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


206
207
208</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 206</span>

<span class='def def kw'>def</span> <span class='table_path identifier id'>table_path</span><span class='lparen token'>(</span><span class='slug identifier id'>slug</span><span class='rparen token'>)</span>
  <span class='dstring node'>&quot;#{TableSetter.table_path}#{slug}.yml&quot;</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="csv_data-instance_method">
  
    - (<tt>Object</tt>) <strong>csv_data</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The csv_data for the table fu instance is loaded either from the remote
source or from a local file, depending on the keys present in the yaml
file.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


42
43
44
45
46
47</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 42</span>

<span class='def def kw'>def</span> <span class='csv_data identifier id'>csv_data</span>
  <span class='case case kw'>case</span>
  <span class='when when kw'>when</span> <span class='google_key identifier id'>google_key</span> <span class='orop op'>||</span> <span class='url identifier id'>url</span> <span class='then then kw'>then</span> <span class='Curl constant id'>Curl</span><span class='colon2 op'>::</span><span class='Easy constant id'>Easy</span><span class='dot token'>.</span><span class='perform identifier id'>perform</span><span class='lparen token'>(</span><span class='uri identifier id'>uri</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='body_str identifier id'>body_str</span>
  <span class='when when kw'>when</span> <span class='file identifier id'>file</span> <span class='then then kw'>then</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='uri identifier id'>uri</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='read identifier id'>read</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="faceted?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>faceted?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


65
66
67</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 65</span>

<span class='def def kw'>def</span> <span class='faceted? fid id'>faceted?</span>
  <span class='notop op'>!</span><span class='@facets ivar id'>@facets</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hard_paginate?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>hard_paginate?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
hard_paginate instructs the app to render batches of a table.
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


75
76
77</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 75</span>

<span class='def def kw'>def</span> <span class='hard_paginate? fid id'>hard_paginate?</span>
  <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:hard_paginate</span><span class='rbrack token'>]</span> <span class='eq op'>==</span> <span class='true true kw'>true</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="load-instance_method">
  
    - (<tt>Object</tt>) <strong>load</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The load method handles the actual request either to the file system or
remote url. It performs the requested data manipulations form the yml file
after the data has been loaded. We&#8217;re keeping this explicit to
control against unnecessary http requests.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29
30
31
32
33
34
35
36
37
38</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 27</span>

<span class='def def kw'>def</span> <span class='load identifier id'>load</span>
  <span class='csv identifier id'>csv</span> <span class='assign token'>=</span> <span class='csv_data identifier id'>csv_data</span>
  <span class='if if kw'>if</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:column_options</span><span class='rbrack token'>]</span>
    <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:column_options</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='string val'>'style'</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
  <span class='end end kw'>end</span>
  <span class='@data ivar id'>@data</span> <span class='assign token'>=</span> <span class='TableFu constant id'>TableFu</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='csv_data identifier id'>csv_data</span><span class='comma token'>,</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:column_options</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:faceting</span><span class='rbrack token'>]</span>
    <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='col_opts identifier id'>col_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:ignored</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:faceting</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:facet_by</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span>
    <span class='@facets ivar id'>@facets</span> <span class='assign token'>=</span> <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='faceted_by identifier id'>faceted_by</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:faceting</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:facet_by</span><span class='rbrack token'>]</span>
  <span class='end end kw'>end</span>
  <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='delete_rows! fid id'>delete_rows!</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:dead_rows</span><span class='rbrack token'>]</span> <span class='if if_mod kw'>if</span> <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:dead_rows</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="paginate!-instance_method">
  
    - (<tt>Object</tt>) <strong>paginate!</strong>(curr_page) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
paginate uses TableFu&#8217;s only! method to batch the table. It also
computes the page attributes which are nil and meaningless otherwise.
</p>


  </div>
</div>
<div class="tags">
  <h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


86
87
88
89
90
91
92
93
94</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 86</span>

<span class='def def kw'>def</span> <span class='paginate! fid id'>paginate!</span><span class='lparen token'>(</span><span class='curr_page identifier id'>curr_page</span><span class='rparen token'>)</span>
  <span class='return return kw'>return</span> <span class='if if_mod kw'>if</span> <span class='notop op'>!</span><span class='hard_paginate? fid id'>hard_paginate?</span>
  <span class='@page ivar id'>@page</span> <span class='assign token'>=</span> <span class='curr_page identifier id'>curr_page</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span>
  <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span> <span class='if if_mod kw'>if</span> <span class='@page ivar id'>@page</span> <span class='lt op'>&lt;</span> <span class='integer val'>1</span> <span class='orop op'>||</span> <span class='@page ivar id'>@page</span> <span class='gt op'>&gt;</span> <span class='total_pages identifier id'>total_pages</span>
  <span class='adj_page identifier id'>adj_page</span> <span class='assign token'>=</span> <span class='@page ivar id'>@page</span> <span class='minus op'>-</span> <span class='integer val'>1</span> <span class='gt op'>&gt;</span> <span class='integer val'>0</span> <span class='question op'>?</span> <span class='@page ivar id'>@page</span> <span class='minus op'>-</span> <span class='integer val'>1</span> <span class='colon op'>:</span> <span class='integer val'>0</span>
  <span class='@prev_page ivar id'>@prev_page</span> <span class='assign token'>=</span> <span class='adj_page identifier id'>adj_page</span> <span class='gt op'>&gt;</span> <span class='integer val'>0</span> <span class='question op'>?</span> <span class='adj_page identifier id'>adj_page</span> <span class='colon op'>:</span> <span class='nil nil kw'>nil</span>
  <span class='@next_page ivar id'>@next_page</span> <span class='assign token'>=</span> <span class='page identifier id'>page</span> <span class='lt op'>&lt;</span> <span class='total_pages identifier id'>total_pages</span> <span class='integer val'>? </span><span class='lparen token'>(</span><span class='@page ivar id'>@page</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='nil nil kw'>nil</span>
  <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='only! fid id'>only!</span><span class='lparen token'>(</span><span class='adj_page identifier id'>adj_page</span> <span class='mult op'>*</span> <span class='per_page identifier id'>per_page</span><span class='dot2 op'>..</span><span class='lparen token'>(</span><span class='@page ivar id'>@page</span> <span class='mult op'>*</span> <span class='per_page identifier id'>per_page</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="per_page-instance_method">
  
    - (<tt>Object</tt>) <strong>per_page</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The number of rows per page. Defaults to 20
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


80
81
82</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 80</span>

<span class='def def kw'>def</span> <span class='per_page identifier id'>per_page</span>
  <span class='@table_opts ivar id'>@table_opts</span><span class='lbrack token'>[</span><span class='symbol val'>:per_page</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='integer val'>20</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="sort_array-instance_method">
  
    - (<tt>Object</tt>) <strong>sort_array</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A convienence method to return the sort array for table setter.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


104
105
106
107
108
109
110</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 104</span>

<span class='def def kw'>def</span> <span class='sort_array identifier id'>sort_array</span>
  <span class='if if kw'>if</span> <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='sorted_by identifier id'>sorted_by</span>
    <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='sorted_by identifier id'>sorted_by</span><span class='dot token'>.</span><span class='inject identifier id'>inject</span><span class='lparen token'>(</span><span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='memo identifier id'>memo</span><span class='comma token'>,</span> <span class='lparen token'>(</span><span class='key identifier id'>key</span><span class='comma token'>,</span> <span class='value identifier id'>value</span><span class='rparen token'>)</span><span class='bitor op'>|</span>
      <span class='memo identifier id'>memo</span> <span class='lshft op'>&lt;&lt;</span> <span class='lbrack token'>[</span><span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='columns identifier id'>columns</span><span class='dot token'>.</span><span class='index identifier id'>index</span><span class='lparen token'>(</span><span class='key identifier id'>key</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='value identifier id'>value</span> <span class='eq op'>==</span> <span class='string val'>'descending'</span> <span class='question op'>?</span> <span class='integer val'>1</span> <span class='colon op'>:</span> <span class='integer val'>0</span><span class='rbrack token'>]</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="sortable?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>sortable?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A table isn&#8217;t sortable by tablesorter if it&#8217;s either faceted or
multi-page paginated.
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


70
71
72</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 70</span>

<span class='def def kw'>def</span> <span class='sortable? fid id'>sortable?</span>
  <span class='notop op'>!</span><span class='faceted? fid id'>faceted?</span> <span class='andop op'>&amp;&amp;</span> <span class='notop op'>!</span><span class='hard_paginate? fid id'>hard_paginate?</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="total_pages-instance_method">
  
    - (<tt>Object</tt>) <strong>total_pages</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The total pages we&#8217;ll have. We need to calculate it before paginate,
so that we still have the full @data.rows.length
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


99
100
101</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 99</span>

<span class='def def kw'>def</span> <span class='total_pages identifier id'>total_pages</span>
  <span class='@total_pages ivar id'>@total_pages</span> <span class='opasgn op'>||=</span> <span class='lparen token'>(</span><span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='div op'>/</span> <span class='per_page identifier id'>per_page</span><span class='dot token'>.</span><span class='to_f identifier id'>to_f</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='ceil identifier id'>ceil</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="updated_at-instance_method">
  
    - (<tt>Object</tt>) <strong>updated_at</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The real <tt>updated_at</tt> of a Table instance is the newer modification
time of the csv file or the yaml file. Updates to either resource should
break the cache.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


60
61
62
63</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 60</span>

<span class='def def kw'>def</span> <span class='updated_at identifier id'>updated_at</span>
  <span class='csv_time identifier id'>csv_time</span> <span class='assign token'>=</span> <span class='google_key identifier id'>google_key</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span> <span class='integer val'>? </span><span class='modification_time identifier id'>modification_time</span><span class='lparen token'>(</span><span class='uri identifier id'>uri</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='google_modification_time identifier id'>google_modification_time</span>
  <span class='lparen token'>(</span><span class='csv_time identifier id'>csv_time</span> <span class='gt op'>&gt;</span> <span class='yaml_time identifier id'>yaml_time</span> <span class='integer val'>? </span><span class='csv_time identifier id'>csv_time</span> <span class='colon op'>:</span> <span class='yaml_time identifier id'>yaml_time</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="uri-instance_method">
  
    - (<tt>Object</tt>) <strong>uri</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns a usable uri based on what sort of input we have.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


50
51
52
53
54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/table.rb', line 50</span>

<span class='def def kw'>def</span> <span class='uri identifier id'>uri</span>
  <span class='case case kw'>case</span>
  <span class='when when kw'>when</span> <span class='google_key identifier id'>google_key</span> <span class='then then kw'>then</span> <span class='dstring node'>&quot;http://spreadsheets.google.com/pub?key=#{google_key}&amp;output=csv&quot;</span>
  <span class='when when kw'>when</span> <span class='url identifier id'>url</span> <span class='then then kw'>then</span> <span class='url identifier id'>url</span>
  <span class='when when kw'>when</span> <span class='file identifier id'>file</span> <span class='then then kw'>then</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='expand_path identifier id'>expand_path</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{TableSetter.table_path}#{file}&quot;</span><span class='rparen token'>)</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Thu Apr 14 16:57:06 2011 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.6.1 (ruby-1.8.7).
</div>

  </body>
</html>